#!/bin/bash

echo "############## Install Packages ###############"
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-python snmpd snmp python-netsnmp python-pip
sudo pip install -U -f http://code.google.com/p/google-visualization-python/ gviz-api-py

echo "############## Configuration ###################"
sudo rm -f /etc/apache2/apache2.conf
sudo cp ./etc/apache2/apache2.conf   /etc/apache2/apache2.conf
sudo rm -f /etc/snmp/snmpd.conf
sudo cp ./etc/snmp/snmpd.conf       /etc/snmp/snmpd.conf

sudo mkdir -p /var/www/python/
sudo cp -R views/ /var/www/
sudo cp -R snmp/ /var/www/python/



echo "############# Start service ####################"
sudo service snmpd restart
sudo service apache2 restart


echo "
################# Summary ######################
#                                              # 
# URL: http://127.0.0.1/views/cpu_usage.html   #
#                                              #
# to see from remote browser                   #
# edit /var/www/html/views/cpu_usage.html      #
#                                              #
#   127.0.0.1 to <Your Server IP>              #
#                                              #
# Copyright : Choonho Son                      #
#   https://code.google.com/p/quicksee         #
################################################
"

